//
//  WmcDictionaryEx.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/6/8.
//

import Foundation

extension Dictionary {
    func ascendingSortJsonFields() -> String {
        /**
        var jsonString: String = ""
        
        if #available(iOS 11.0, *) {
            let jsonData  = try? JSONSerialization.data(withJSONObject: self, options: [.sortedKeys])
            jsonString = String(data: jsonData!, encoding: .utf8) ?? ""
        } else {
            jsonString = NSDictionary.jsonString(withDict: self, ascending: true)
        }
        */
        
        let jsonString: String = NSDictionary.jsonString(withDict: self, ascending: true)
        
        return jsonString
    }
}
